package cqut.wys.controller;

import cqut.wys.dao.entity.News;
import cqut.wys.dao.mapper.news.NewsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wuyoushan
 * @date 2018/2/25
 */
@RestController
public class NewsController {

    @Autowired
    private NewsMapper newsMapper;

    @GetMapping("/getNews/{id}")
    public News getAllNews(@PathVariable Integer id){
        return newsMapper.findNewByID(id);
    }
}
